package com.itheima.reggie.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.reggie.entity.Orders;
import com.itheima.reggie.dto.OrdersDto;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;

public interface OrdersService extends IService<Orders> {
    /**
     * 用户下单
     * @param orders
     */
    @Transactional
    Orders submit(Orders orders);

    /**
     * 查看订单
     *
     * @param page
     * @param pageSize
     * @param userId
     * @return
     */
    Page<OrdersDto> pageByUserId(int page, int pageSize, Object userId);

    /**
     * 管理系统查看订单
     *
     * @param page
     * @param pageSize
     * @param number
     * @param beginTime
     * @param endTime
     * @return
     */
    Page<Orders> pageByMany(int page, int pageSize, String number, LocalDateTime beginTime, LocalDateTime endTime);

    /**
     * 再来一单
     *
     * @param orders
     */
    public Orders again(Orders orders);
}
